//
//  TDAppCenterCell.m
//  TFB
//
//  Created by yull on 15/8/14.
//  Copyright (c) 2015年 TD. All rights reserved.
//

#import "TDAppCenterCell.h"

@implementation TDAppCenterCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.layer.borderColor = [UIColor lightGrayColor].CGColor;
        self.layer.borderWidth = 0.5;
        
        UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 30, 50, 50)];
        imageView.center = CGPointMake(self.frame.size.width / 2, imageView.center.y);
        [self.contentView addSubview:imageView];
        self.imageView = imageView;
        
        UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(imageView.frame) + 10, 100, 20)];
        titleLabel.center = CGPointMake(self.frame.size.width / 2, titleLabel.center.y);
        titleLabel.textAlignment = NSTextAlignmentCenter;
        titleLabel.font = [UIFont systemFontOfSize:15];
        [self.contentView addSubview:titleLabel];
        self.titleLabel = titleLabel;
        
        JSBadgeView *badgeView = [[JSBadgeView alloc] initWithParentView:imageView alignment:JSBadgeViewAlignmentTopRight];
        self.badgeView = badgeView;
    }
    return self;
}

@end
